//
//  IMTNavigationController.m
//  INMOTION
//
//  Created by 孙凯旋 on 14-9-25.
//  Copyright (c) 2014年 Inmotion. All rights reserved.
//

#import "IMTNavigationController.h"
#import "IMTConfig.h"

@interface IMTNavigationController ()

@end

@implementation IMTNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNavigations];
}

- (void)setNavigations {
    if (@available(iOS 15.0, *)) {
        UINavigationBarAppearance *appperance = [[UINavigationBarAppearance alloc] init];
        //添加背景色
        appperance.backgroundColor = kIMTDefaultOrangeColor;
        appperance.shadowImage = [[UIImage alloc]init];
        appperance.shadowColor = nil;
        [appperance setTitleTextAttributes:@{NSForegroundColorAttributeName:kIMTDefaultTitleColor,
                                             NSFontAttributeName:[UIFont fontWithName:@"Helvetica-Bold" size:17]}];
        self.navigationBar.standardAppearance = appperance;
        self.navigationBar.scrollEdgeAppearance = appperance;
        self.navigationBar.compactAppearance = appperance;
        self.navigationBar.compactScrollEdgeAppearance = appperance;
    } else {
        self.navigationBar.barTintColor = kIMTDefaultOrangeColor;
        self.navigationBar.shadowImage = [UIImage new];
        [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : kIMTDefaultTitleColor,
                                                                          NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:17]}];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (BOOL)shouldAutorotate {
    return false;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

@end
